var Item = function(xmlItem) {
	this.metadata = {
		href: XML.getValueForTag(xmlItem, 'D:href'),
		providerId: XML.getValueForTag(xmlItem, 'mc:resourceprovider'),
		id: XML.getValueForTag(xmlItem, 'mc:id'),
		mcsNS: xmlItem.getAttribute('xmlns:mcs')
	};
	this.fields = new Hash();
	
	this.fields['Name'] = {
		'label': 'Name',
		'tagName': 'mc:name',
		'userEditable': false,
		'displayType': 'Text',
		'value': XML.getValueForTag(xmlItem, 'mc:name'),
		'tagClass': 'mc:name'.slice('mc:name'.lastIndexOf(':')+1)
	};
	
	this.fields['Published'] = {
		'label': 'Published',
		'tagName': 'mc:published',
		'userEditable': true,
		'displayType': 'checkbox',
		'value': XML.getValueForTag(xmlItem, 'mc:published'),
		'tagClass': 'mc:published'.slice('mc:published'.lastIndexOf(':')+1)
	};
	
	var mcsSpec = XML.convertToArray(XML.getElementsByTagNameNS(xmlItem, 'mcs'));
	
	mcsSpec.each(function(spec) {
		var label = spec.getAttribute('label'),
			displayType = spec.getAttribute('displayType'),
			editable = spec.getAttribute('userEditable') == "true" ? true : false,
			tagName = spec.tagName,
			value = spec.textContent ? spec.textContent : spec.text;
		if (label) {
			this.fields[label] = {
				'label': label,
				'tagName': tagName,
				'displayType': displayType,
				'userEditable': editable,
				'value': value,
				'tagClass': tagName.slice(tagName.lastIndexOf(':')+1)
			};
		}
	}, this);
	
};